clear*
set maxvar 11000

global date _2025_10_28
cd "/Users/atri0032/Dropbox/World Bank/Temperature, poverty, and inequality/Estimations/"

******************************************************************************************
********************************** Table S8: The effects of temperature on poverty gap
******************************************************************************************

use "${date}/_data/spid_for_analysis_v2.dta", clear

local controls ln_GDPppp Unempilo agri manuf popgr 

estimates clear
forval i=1/10 {
qui reghdfe gap`i'_215 temp rainfall_sum humid `controls', absorb(geo_code2_new year) cluster(geo_code2_new) keepsingle	
	est store m215_`i'
}

local opts ///
	cells(b(star fmt(3)) se(par fmt(3))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2, fmt(0 0 0 3) ///
	label("Observations" "R-squared")) ///
	eqlabels(none) ///
	collabels(,none) varlabels(temp "Temperature" rainfall_ave "Rainfall" humid "Humidity") varwidth(25)	
	
	
esttab m215_*, `opts'
esttab m215_* using "${date}/_tables/_tab_s8.csv", replace `opts'

